<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::get('/00000', 'ProductController@test');

Route::get('/00001', 'ProductController@getProductList');

//获取商品类别分页
Route::get('/10000', 'CategoryController@selectCategory')->middleware('HeaderToken');
//添加商品类别
Route::post('/10001', 'CategoryController@addCategory');
//修改商品类别
Route::post('/10002', 'CategoryController@updateCategory');
//删除商品类别
Route::post('/10003', 'CategoryController@delCategory');
//获取单条类别
Route::get('/10005/{id}', 'CategoryController@showCategory');
//获取所有商品类别
Route::get('/10004', 'CategoryController@getAllCategory');

//查询商品
Route::get('/10010/{id}', 'ProductController@selectProduct');
//添加商品
Route::post('/10011', 'ProductController@addProduct');
//修改商品
Route::post('/10012', 'ProductController@updateProduct');
//删除商品
Route::post('/10013', 'ProductController@delProduct');

//查询标签
Route::get('/10020/{id}', 'ProductTagController@selectProductTag');
//添加标签
Route::post('/10021', 'ProductTagController@addProductTag');
//修改标签
Route::post('/10022', 'ProductTagController@updateProductTag');
//删除标签
Route::post('/10023', 'ProductTagController@delProductTag');

//查询库存
Route::get('/10030/{id}', 'SkuController@selectSku');
//添加库存
Route::post('/10031', 'SkuController@addSku');
//修改库存
Route::post('/10032', 'SkuController@updateSku');
//删除库存
Route::post('/10033', 'SkuController@delSku');

//查询导航
Route::get('/10040/{id}', 'NavController@selectNav');
//添加导航
Route::post('/10041', 'NavController@addNav');
//修改导航
Route::post('/10042', 'NavController@updateNav');
//删除导航
Route::post('/10043', 'NavController@delNav');


//上传图片
Route::post('/10050', 'UploadController@upload');
//获取图片
Route::get('/10051/{uuid}', 'UploadController@getImg');

//登陆
Route::post('/10060', "LoginController@login");


Route::post('/10070',"OrderController@create");
